﻿using System;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

// Token: 0x020003C6 RID: 966
[RequireComponent(typeof(Text))]
public class ToggleSwitchText : MonoBehaviour
{
	// Token: 0x0600181A RID: 6170 RVA: 0x0009D730 File Offset: 0x0009B930
	private void Awake()
	{
		this.text = base.GetComponent<Text>();
		this.SetText();
		this.toggle.onValueChanged.AddListener(new UnityAction<bool>(this.OnToggleChange));
	}

	// Token: 0x0600181B RID: 6171 RVA: 0x0009D760 File Offset: 0x0009B960
	private void SetText()
	{
		if (this.toggle != null)
		{
			this.text.text = ((!this.toggle.isOn) ? this.offText : this.onText);
		}
	}

	// Token: 0x0600181C RID: 6172 RVA: 0x0009D7A0 File Offset: 0x0009B9A0
	private void OnToggleChange(bool flag)
	{
		this.SetText();
	}

	// Token: 0x04001B71 RID: 7025
	[SerializeField]
	private Toggle toggle;

	// Token: 0x04001B72 RID: 7026
	private Text text;

	// Token: 0x04001B73 RID: 7027
	[SerializeField]
	private string offText;

	// Token: 0x04001B74 RID: 7028
	[SerializeField]
	private string onText;
}
